package com.zhss.demo.dubbo.nacos;



import com.zhss.demo.dubbo.nacos.api.ServiceA;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author fan
 * @version 1.0v
 * @Description TODO
 * @date 2021-02-03 03:59
 * @email 44867924@qq.com
 */
@RestController
public class TestController {

    /**
     *  这里使用的是动态代理
     */
    @Reference(
            version="1.0.0",
            interfaceClass= ServiceA.class,
            cluster="failfast"
    )
    private ServiceA serviceA;

    @GetMapping("/greet")
    public String greet(String userName,String password){
        return serviceA.greet(userName,password);
    }
}
